I need to modify few attributes and need exclusive edit access for the target module. Before I try to open the module in exclusive edit mode, I need to check that I have adequate access for the target module. if I don't have enough access, I want to skip the module. |
Re: CanModify vs isEdit |
Re: CanModify vs isEdit faisal.zahidi@boeing.com - Fri Jun 11 21:23:10 EDT 2010
The 'bool canModify(Module m)' perm tells you if you can modify the module right now. edit(module_name, false, true)
string user = doorsname Module m = current print hasPermission(user, m, modify)
|
Re: CanModify vs isEdit a_vestlin - Mon Jun 14 02:17:42 EDT 2010
The 'bool canModify(Module m)' perm tells you if you can modify the module right now. edit(module_name, false, true)
string user = doorsname Module m = current print hasPermission(user, m, modify)
yes. Module mod = edit(NameModFull, false, true) if (null mod) log cannot open module elseif(!isEdit(mod)) log cannot edit module; close(mod) else deal with edited mod; save(mod); close(mod)
|
Re: CanModify vs isEdit llandale - Tue Jun 15 14:04:57 EDT 2010
yes. Module mod = edit(NameModFull, false, true) if (null mod) log cannot open module elseif(!isEdit(mod)) log cannot edit module; close(mod) else deal with edited mod; save(mod); close(mod)
Thank you so much. Works! FZ |
Re: CanModify vs isEdit
a_vestlin wrote:
The 'bool canModify(Module m)' perm tells you if you can modify the module right now. You need to open the module in Edit Exclusive mode before you make this check. An alternative is to use the 'Module edit(string s, bool visible, bool dontAsk)' perm instead, edit(module_name, false, true) will only open the module in edit mode if it is possible. If you really like to determine if you have the right access rights you should use the 'hasPermission(string username, Module m, Permission p)' perm. For example: string user = doorsname Module m = current print hasPermission(user, m, modify) /Anders
|
Re: CanModify vs isEdit |